#include "begin.h"
#include "ui_begin.h"
#include "mainwidget.h"

begin::begin(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::begin)
{
    ui->setupUi(this);
    this->setFixedSize(800,800);
    setWindowTitle("typing game");

}

begin::~begin()
{
    delete ui;
}

void begin::on_pushButton_clicked()
{    start = new QSoundEffect(this);
    start->setSource(QUrl("qrc:///kaishianniu.wav"));
    start->setLoopCount(1);//循环次数
    start->setVolume(0.2f);//音量
    start->play();
    mainWidget *w = new mainWidget;

    this->close();
    w->show();


}


void begin::on_pushButton_2_clicked()
{    end = new QSoundEffect(this);
        end->setSource(QUrl("qrc:///tuichu.wav"));
        end->setLoopCount(1);//循环次数
        end->setVolume(0.2f);//音量
        end->play();
    this->close();
}

